<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\CategoryGroupBean;

class CategoryGroupValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';
	static $storeType='storeType';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 CategoryGroupBean::$id => 'require', //
			 CategoryGroupBean::$storeId => 'require', //商家id
			 CategoryGroupBean::$categoryIds => 'require|max:255', //类型组合
			 CategoryGroupBean::$type => 'require', //类型（1、洗照片，2证件照，3打印）
			 CategoryGroupBean::$price => 'require', //组合价格
			 CategoryGroupBean::$vipPrice => 'require', //会员价
			 CategoryGroupBean::$createdAt => 'require', //
		];
		$this->message = [
			CategoryGroupBean::$id.POINST."require " => 'id必须', //
			CategoryGroupBean::$storeId.POINST."require " => 'store_id必须', //商家id
			CategoryGroupBean::$categoryIds.POINST."require " => 'category_ids必须', //类型组合
			CategoryGroupBean::$type.POINST."require " => 'type必须', //类型（1、洗照片，2证件照，3打印）
			CategoryGroupBean::$price.POINST."require " => 'price必须', //组合价格
			CategoryGroupBean::$vipPrice.POINST."require " => 'vip_price必须', //会员价
			CategoryGroupBean::$createdAt.POINST."require " => 'created_at必须', //
		];
		$this->scene = [
			self::$all => [
				CategoryGroupBean::$id,
				CategoryGroupBean::$storeId,
				CategoryGroupBean::$categoryIds,
				CategoryGroupBean::$type,
				CategoryGroupBean::$price,
				CategoryGroupBean::$createdAt,
			],
			self::$add => [
			],
			self::$edit => [
			],
			self::$pkId => [CategoryGroupBean::$id],
            self::$storeType => [CategoryGroupBean::$storeId,CategoryGroupBean::$type,]

		];
	}


}
